package site.assad.anno;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/11/30 13:49
 * Description: 用于演示对集合进行自动注入
 */
@Component("myComponent")
public class MyCompoent {

    //自动注入所有符合List集合元素要求的Plugin
    @Autowired(required = false)
    private List<Plugin> plugins;

    //自动注入所有符合Map类型要求的元素
    @Autowired(required = false)
    private Map<String,Plugin> pluginMaps;

    public List<Plugin> getPlugins(){
        return this.plugins;
    }
    public  Map<String,Plugin> getPluginMaps(){
        return this.pluginMaps;
    }

}
